import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve:{
    alias:{
      "@": resolve(__dirname, 'src'), 
      
    },
    extensions: ['.js', '.json', '.ts']
  },
  server:{
    https:false,
    proxy:{
      '/index.php/Upload/uploadAvatar':{
        target:'http://127.0.0.1',
        changeOrigin:true,
      },
      '/index.php/User/user':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/Role/role':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/Resources/resources':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/Login/login':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/Login/logout':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/avatar':{
        target:'http://127.0.0.1/',
        changeOrigin:true
      },
      '/index.php/RoleResources/RoleResources':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/UserRole/UserRole':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/Login/getAuth':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/StationMange/StationMange':{
        target:'http://127.0.0.1',
        changeOrigin:true
      },
      '/index.php/StationMange/StationMangeSearch':{
        target:'http://127.0.0.1',
        changeOrigin:true
      }
    }
  }
})
